package com.example.dangerouscargodriver.ui.activity;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.webkit.WebSettings;
import android.webkit.WebView;

import com.example.dangerouscargodriver.R;
import com.example.dangerouscargodriver.widget.ActionBar;

public class UserGuideDetailInfoActivity extends AppCompatActivity {

    private WebView mUserGuideView = null;
    private ActionBar mActionBar = null;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_user_guide_detail_info);

        mUserGuideView = findViewById(R.id.webview_show_html);
        WebSettings webSettings = mUserGuideView.getSettings();
        webSettings.setLoadWithOverviewMode(true);
        //缩放开关
        webSettings.setSupportZoom(false);
        //设置此属性，仅支持双击缩放，不支持触摸缩放（在android4.0是这样，其他平台没试过）
        // 设置是否可缩放
        webSettings.setBuiltInZoomControls(false);
        mUserGuideView.setHorizontalScrollBarEnabled(false);
        if(getIntent().getStringExtra("url") != null) {
            mUserGuideView.loadUrl(getIntent().getStringExtra("url"));
        }

        mActionBar = findViewById(R.id.actionBarUserGuideDetailInfo);
        mActionBar.setOnBackClickListener( new View.OnClickListener(){

            @Override
            public void onClick(View v) {
                finish();
            }
        });
    }
}